package controller;

import entity.BannerEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import service.serviceImpl.BannerService;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("")
public class IndexController {

    @Resource
    BannerService bannerService;

    @RequestMapping("/index")
    public ModelAndView index(){
        ModelAndView mav = new ModelAndView("/index");
        BannerEntity bannerEntity = new BannerEntity();
        bannerEntity.setStatus(1);
        List<BannerEntity> bannerList = bannerService.getBanner(bannerEntity);
        mav.addObject("bannerList",bannerList);
        return mav;
    }
}
